package com.clw.repository;

import com.clw.dataobject.Feature;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Administrator on 2017-12-15.
 */
public interface FeatureRepository extends JpaRepository<Feature,Integer>{

    Long countByPidAndStatus(Integer pid, Integer status);

    List<Feature> findByStatus(Integer status);

    @Query(value = "select c.id,c.name from call_me_goods_category c where c.status=1",nativeQuery = true)
    List<Object[]> getCategory();

    @Query(value = "select id,departname,parentdepartid,type from  ts_depart where status=1 and id=?1",nativeQuery = true)
    Object[] getParentDepart(String id);

    @Query(value = "select f from  Feature  f where f.status=1 and f.name ='供应商信息'")
    List<Feature> getSimpleList();
}
